﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using WooCoo.Data;
using WooCoo.ObjectModel;
using WooCoo.ObjectModel.ManagedProperty;
using WooCooTest.Model;

namespace WooCooTest
{
    [Serializable]
    //[Table("OrgInfo",PrimaryKeys="KeyID")]
    public class OrgInfo : WooCoo.ObjectModel.Entity
    {
        public OrgInfo()
        {           
        }       

        public override object GetIdValue()
        {
            return this.KeyID.ToString();
        }

        public static readonly PropertyInfo<string> KeyIDProperty = P<OrgInfo>.RegisterProperty<string>(c => c.KeyID);
        public string KeyID
        {
            get { return this.GetProperty<string>(KeyIDProperty); }
            set { this.SetProperty<string>(KeyIDProperty, value); }
        }

        public static readonly PropertyInfo<int> OrgIDProperty = P<OrgInfo>.RegisterProperty<int>(c => c.OrgID);
        public int OrgID
        {
            get { return this.GetProperty<int>(OrgIDProperty); }
            set { this.SetProperty<int>(OrgIDProperty, value); }
        }

        public static readonly PropertyInfo<UserInfo> UsersProperty = P<OrgInfo>.RegisterProperty<UserInfo>(c=>c.Users);
        public UserInfo Users
        {
            get { return this.GetProperty<UserInfo>(UsersProperty); }
            set { this.SetProperty<UserInfo>(UsersProperty,value); }
        }

        public static readonly PropertyInfo<EntityList<UserInfo>> UserListProperty = P<OrgInfo>.RegisterProperty<EntityList<UserInfo>>(c => c.UserList);
        public EntityList<UserInfo> UserList
        {
            get { return this.GetProperty<EntityList<UserInfo>>(UserListProperty); }
            set { this.SetProperty<EntityList<UserInfo>>(UserListProperty, value); }
        }


    }
}
